/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.gfl.trivialrestclient.services;

import com.gfl.trivialrestclient.model.Product;
import java.util.List;

/**
 *
 * @author student
 */
public interface ProductService extends GenericService<Product, Long> {

    /**
     * Create new product
     *
     * @param product
     * @return
     * @throws unchecked ProductServiceException
     */
    public Product create(Product product) throws ProductServiceException;

    /**
     * Remove product by id
     *
     * @param id
     * @throws unchecked ProductServiceException if product with such id not
     * exists or id is null
     */
    public void delete(Long id) throws ProductServiceException;

    /**
     * Get product by id
     *
     * @param id
     * @return
     * @throws unchecked ProductServiceException if product with such id not
     * exists or id is null
     */
    public Product read(Long id) throws ProductServiceException;

    /**
     * Update existed value
     *
     * @param product
     * @return
     * @throws unchecked ProductServiceException
     */
    public Product edit(Long id, Product product) throws ProductServiceException;

    /**
     * Retrieve list of all products
     *
     * @return List of all products
     * @throws unchecked ProductServiceException
     */
    public List<Product> readAll() throws ProductServiceException;
}
